Skip to content

Mark interface methods abstract when read from source - #886

Merged
Firehed merged 2 commits into
mainfrom
interface-methods-abstract
Oct 29, 2026
Merged

Firehed merged 2 commits into
mainfrom
interface-methods-abstract

Conversation

@Firehed

@Firehed Firehed commented Oct 29, 2026

Copy link
Copy Markdown
Owner

An interface method's MethodInfo now says it is abstract when it is read from source, as it already did when read through reflection. PHP marks every interface method abstract (php-src zend_compile.c, zend_begin_method_decl: if (in_interface) … fn_flags |= ZEND_ACC_ABSTRACT), and BuiltinBackend reports that through ReflectionMethod::isAbstract(). ParsedDeclarationSource read only the abstract modifier, which interface methods never carry, so the same declaration differed by where it came from (ADR 0006).

Behavior

Hover on an interface method declared in the project now shows abstract, as it already did for built-in interfaces such as Countable::count().

Why now

Upcoming work on which members an access may reach (#881) rejects abstract methods called through Foo::, self:: or parent::, as PHP does. That needs the flag to be right wherever the method was read from.

🤖 Generated with Claude Code

Firehed and others added 2 commits October 29, 2026 13:38
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.70%. Comparing base (91c383b) to head (5c19dd9).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #886   +/-   ##
=========================================
  Coverage     99.70%   99.70%           
- Complexity     1951     1952    +1     
=========================================
  Files           146      146           
  Lines          4459     4459           
=========================================
  Hits           4446     4446           
  Misses           13       13           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@Firehed
Firehed marked this pull request as ready for review October 29, 2026 20:44
@Firehed
Firehed merged commit 7faf80c into main Oct 29, 2026
8 checks passed
@Firehed
Firehed deleted the interface-methods-abstract branch October 29, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant